package v1

import (
	"gf_blog_admin/internal/model"
	"github.com/gogf/gf/v2/frame/g"
)

type UserListReq struct {
	g.Meta `path:"/system/user" method:"get" tags:"system" sm:"用户列表" can:"system.user"`
	model.UserListInput
}

type UserListRes struct {
	Total int                   `json:"total" dc:"数据总数"`
	Rows  []*model.UserListItem `json:"rows" dc:"列表集合"`
}

type UserShowReq struct {
	g.Meta `path:"/system/user/show/{id}" method:"get" tags:"system" sm:"用户详情" can:"system.user.show"`
	Id     uint64 `json:"id" in:"query" v:"required|min:1" dc:"用户id"`
}

type UserShowRes struct {
	*model.UserItem
}

type UserStoreReq struct {
	g.Meta `path:"/system/user/store" method:"post" tags:"system" sm:"用户创建" can:"system.user.store"`
	model.UserFormInput
}

type UserStoreRes struct{}

type UserUpdateReq struct {
	g.Meta `path:"/system/user/update/{id}" method:"put" tags:"system" sm:"用户更新" can:"system.user.update"`
	Id     uint64 `json:"id" in:"query" v:"required|min:1" dc:"用户id"`
	model.UserFormInput
}

type UserUpdateRes struct{}

type UserDestroyReq struct {
	g.Meta `path:"/system/user/destroy" method:"delete" tags:"system" sm:"用户删除" can:"system.user.destroy"`
	Ids    []uint64 `json:"ids" v:"required|array|max-length:200" dc:"用户id集合"`
}

type UserDestroyRes struct{}

type UserResetPwdReq struct {
	g.Meta   `path:"/system/user/reset_pwd/{id}" method:"put" tags:"system" sm:"用户重置密码" can:"system.user.reset_pwd"`
	Id       uint64 `json:"id" in:"query" v:"required|min:1" dc:"用户id"`
	Password string `json:"password" v:"required"  dc:"密码"`
}

type UserResetPwdRes struct{}
